package com.qf.cls.application.tcc;

import com.qf.cls.application.entity.Cls;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface IClsTcc {

    /**
     * 新增班级的业务方法
     * @param cls
     * @return
     */
    @TwoPhaseBusinessAction(name = "cls_insert", commitMethod = "myCommit", rollbackMethod = "myRollback")
    int insert(@BusinessActionContextParameter(paramName = "cls") Cls cls);

    /**
     * 提交的方法
     * @return
     */
    boolean myCommit(BusinessActionContext businessActionContext);

    /**
     * 回滚的方法
     * @return
     */
    boolean myRollback(BusinessActionContext businessActionContext);
}
